package ua.kharkov.khpi.tarasenko.bach.analysis.tnr;

import java.util.LinkedList;
import java.util.List;

public class Transaction {
	// a transaction is an ordered list of items
	private final List<Integer> items;

	/**
	 * Constructor
	 * 
	 * @param size
	 *            the size of the transaction
	 */
	public Transaction(int size) {
		// WE USE A LINKEDLIST BECAUSE WE PERFORM MANY DELETE OPERATIONS.
		items = new LinkedList<Integer>();
	}

	/**
	 * Add an item to the transaction.
	 * 
	 * @param item
	 *            an item.
	 */
	public void addItem(Integer item) {
		items.add(item);
	}

	/**
	 * Get the list of items in this transaction
	 * 
	 * @return a List of Integers
	 */
	public List<Integer> getItems() {
		return items;
	}
}
